/**
 * 圆形目标点图标
 * @param ratio 画布大小比例
 * @param red 颜色值r
 * @param green 颜色值g
 * @param blue 颜色值b
 * @returns 数据地址
 */
const RoundTargetImage = (radio?:number,red?:number,green?:number,blue?:number):string=> {
    const r=radio||2;
    const rd=red||255;
    const gn=green||255;
    const bu=blue||255;
    const canvas=document.createElement('canvas');
    canvas.width=canvas.height=20*r;
    const ctx=canvas.getContext('2d')!;
    ctx.miterLimit=4;
    ctx.fillStyle='rgba('+rd+','+gn+','+bu+',0.2)';
    ctx.beginPath();
    ctx.arc(10*r,10*r,9*r,0,2*Math.PI);
    ctx.fill();
    ctx.closePath();
    ctx.fillStyle='rgba('+rd+','+gn+','+bu+',0.5)';
    ctx.beginPath();
    ctx.arc(10*r,10*r,6*r,0,2*Math.PI);
    ctx.fill();
    ctx.closePath();
    ctx.fillStyle='rgba('+rd+','+gn+','+bu+',1)';
    ctx.beginPath();
    ctx.arc(10*r,10*r,3*r,0,2*Math.PI);
    ctx.fill();
    ctx.closePath();
    return canvas.toDataURL('image/png');
};


export {RoundTargetImage};